// FunctionFormerManager.h: interface for the FunctionFormerManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FUNCTIONFORMERMANAGER_H__5840BCE6_4C16_4989_838E_C769B99ACEAE__INCLUDED_)
#define AFX_FUNCTIONFORMERMANAGER_H__5840BCE6_4C16_4989_838E_C769B99ACEAE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Register.h"
#include "ObjectGenerator.h"
#include "FunctionObject.h"

class PartDBReader;
class PartDBReaderInfo;
class Part;
class FunctionFormerManager  
{
public:
	typedef RegisterTemplate<INT, PartDBReaderInfo*> DBFunctionReaders;
	typedef ObjectGenerator<DBFunctionReaders> FunctionReadersGenerator;
	
public:
	FunctionFormerManager();
	virtual ~FunctionFormerManager();

public:
	BOOL GetFunctionSet(INT nID, const CString& strFunctionTable, const CString& strSource);

	static DBFunctionReaders& GetFunctionReaders();
public:
	void CloseFunctionSet();
	FunctionObject* GetNextFunction();
	FunctionObject* GetFirstFunction();
	FunctionObject* GetFunction();
	PartDBReader* GetReader();

protected:
	_RecordsetPtr m_FunctionSet;
	Part* m_pPart;
	static FunctionReadersGenerator m_ReadersGenerator;
};

#endif // !defined(AFX_FUNCTIONFORMERMANAGER_H__5840BCE6_4C16_4989_838E_C769B99ACEAE__INCLUDED_)
